<?xml version="1.0" encoding="UTF-8"?>
<!--
   JBoss, Home of Professional Open Source
   Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
   contributors by the @authors tag. See the copyright.txt in the 
   distribution for a full listing of individual contributors.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   http://www.apache.org/licenses/LICENSE-2.0
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,  
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  -->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<p>This quickstart demonstrates how to implement a simple Authenticator</p>

<ui:fragment rendered="#{identity.loggedIn}">
    <div>Congratulations! You are currently logged in as: <b>#{identity.account.loginName}</b></div>

    <h:form>
        <h:commandButton id="logout" value="Log out" action="#{identity.logout}"/>
    </h:form>
</ui:fragment>

<h:form id="loginForm" rendered="#{not identity.loggedIn}">
    <h:messages globalOnly="true"/>

    <div class="loginRow">
        <h:outputLabel for="name" value="Username" styleClass="loginLabel"/>
        <h:inputText id="name" value="#{loginCredentials.userId}"/>
    </div>

    <div class="loginRow">
        <h:outputLabel for="password" value="Password" styleClass="loginLabel"/>
        <h:inputSecret id="password" value="#{loginCredentials.password}" redisplay="true"/>
    </div>

    <div class="loginRow">

    </div>

    <div class="buttons">
        <h:commandButton id="login" value="Login" action="#{identity.login}" styleClass="loginButton"/>
    </div>

    Tip: you can login with a username/password of jsmith/abc123.

</h:form>

<br style="clear:both"/>

</html>